<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.cap.bts.framework.usermgnt.constant.EmployeeStatus"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>数据同步</title>
<%@include file="../include/include.jsp"%>
<link rel="stylesheet" type="text/css" href="${csspath }/public.css" />
<script type="text/javascript" src="${jspath}/jquery/jquery-2.1.3.js"></script>
<link rel="stylesheet" type="text/css"
	href="${bootstrapPath}/css/bootstrap.css" />
<script type="text/javascript" src="${bootstrapPath}/js/bootstrap.js"></script>
<script type="text/javascript" src="${layerPath }/layer.js"></script>
</head>

<script type="text/javascript">
	$(function() {
		$("#query_btn").click(function() {
			$.ajax({
				url : '${webcontext}/crmdp/dealer/masterinfo/tongbushuju',
				type : 'post',
				data : {
					'fileType' : $("#fileType").val(),
					'synchronizationMethod' : $("#synchronizationMethod").val()
				},
				beforeSend: function(){ 
  					layer.load(1,{
  						offset : [ '20%', '50%' ],
  					});
  				},
				success : function(data) {
					if (data.code == true) {
						jAlert(data.msg, "提示");
						layer.closeAll('loading');
					} else if (data.code == false) {
						jAlert(data.msg, "提示");
						layer.closeAll('loading');
					}
				},
				error : function() {
					jAlert("服务器错误，请联系管理员", "提示");
					layer.closeAll('loading');
				},
			});
		});
	});
</script>

<body>
	<div id="content">
		<form class="form-inline">
			<div class="form-group">
				<label for="fileType">同步数据</label> <select id="fileType"
					name="fileType" class="form-control input-sm" style="width: 200px;">
					<core:forEach items="${masterInfoTypeList}" var="list">
						<option value="${list.code}">${list.value}</option>
					</core:forEach>
				</select> <label for="synchronizationMethod">同步方式</label> <select
					id="synchronizationMethod" name="synchronizationMethod"
					class="form-control input-sm" style="width: 200px;">
					<option value="increment">增量同步</option>
					<option value="full">全量同步</option>
				</select>
				<button id="query_btn" type="button" class="btn btn-success btn-sm">
					<i class="glyphicon glyphicon-repeat" style="color: #FFFFFF"></i>&nbsp;同步数据
				</button>
			</div>
		</form>
	</div>
</body>
</html>